﻿using System;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;

using MB.RuleBase.Common;
using Public;
using Model;
 

namespace  Dao
{
    [ConfigFileName("OracleScript")]
    public class LogicDao : Dao
    {
        private static LogicDao _NewInstance = new LogicDao();

        public static LogicDao NewInstance
        {
            get
            {
                if (_NewInstance == null)
                {
                    _NewInstance = new LogicDao();
                }

                return _NewInstance;
            }
        }

        // 取得用户信息--pda用户登录
        public UserInfo GetUser(string userCode)
        {
            return DatabaseExcuteByXmlHelper.NewInstance.GetObjectsByXml<UserInfo>(ConfigFileName, "GetUserInfo", userCode).FirstOrDefault();
        }

        /// <summary>
        /// 前置仓和正常app登录
        /// </summary>
        /// <param name="userCode"></param>
        /// <returns></returns>
        public UserInfo GetAPPUserInfo(string userCode)
        {
            return DatabaseExcuteByXmlHelper.NewInstance.GetObjectsByXml<UserInfo>(ConfigFileName, "GetUser", userCode).FirstOrDefault();
        }


    }
}
